package com.lin.blog.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lin.blog.entity.Article;
import com.lin.utils.Result;

import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author lin
 * @since 2020-03-08
 */
public interface IArticleService extends IService<Article> {



    /**
     * 通过主键ID查询Article
     * @param id
     * @return
     */
    public Result getArticleContent(Long id);


    /**
     * 插入一条Article记录
     * @param article
     * @return
     */
    public Result saveArticle(Article article) throws Exception;


    /**
     * 通过主键ID删除Article
     * @param id
     * @return
     */
    public Result removeArticle(Long id) throws Exception;

    /**
     * 通过主键ID更新Article
     * @param id
     * @param article
     * @return
     */
    public Result updateArticle(Long id, Article article) throws Exception;


    /**
     * 获取ArticleList时间线
     * @return
     */
    public Result getArticleTimeLine();


    /**
     * 增加文章浏览
     * @param articleId
     * @return
     */
    public Result incrementArticleLooks(Long articleId);

    /**
     * 将Redis里的文章浏览数据存入数据库中
     */
    void transArticleLooksFromRedis2DB();



}
